<template>
	<view class="flex flex-column align-center">
		<image style="width: 346rpx;height: 348rpx;" class="mt-10" src="../../static/common/bg.png"></image>
		<text class="font-28 fw4 cl-21 mt-2">您的拼房已提交</text>
		<text class="font-28 fw4 cl-21 mt-3 mb-7">可邀请好友参与拼房</text>
		<button open-type="share"  class="yaoqing flex justify-center align-center" style="width: 408rpx;height: 76rpx;background: #FFB24B;border-radius: 68rpx;">
			<text class="font-28 fw4 cl-ff">邀请好友</text>
		</button>
		<text @tap="goBack" class="font-28 fw4 cl-70 mt-3">返回首页</text>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id:null,
				shareInfo:{},
			}
		},
		methods: {
			goBack(){
				uni.switchTab({
					url:'/pages/index/index'
				})
			},
			getShareInfo(){
				this.$H.post(this.$api.community_list,{
					id:this.id,
				},{token:true}).then(res=>{
					if(res.code == 1){
						this.shareInfo = res.data.list[0]
					}
				})
			},
		},
		onLoad(option) {
			console.log(option)
			if(option.id){
				this.id = option.id
				this.getShareInfo()
			}
		},
		onShareAppMessage(res) {
				let that = this;
				let pathUrl = '/pages/index/community?id='+this.shareInfo.id
				if (res.from === 'button') {
					return {
						title:this.shareInfo.apartment_title,
						path: pathUrl,
						imageUrl:this.shareInfo.room.thumb
					};
				}
				
			},
	}
</script>

<style>
	button::after{
	 	border: none;
	}
	.yaoqing{
		
		background-color: #fff;
		padding-left:0;
		padding-right: 0;
	
		}
</style>
